home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / MacOS 8 Resources / Developer Tools / Mac OS 8 Interfaces & Libraries / Interfaces / AIncludes / Scrap.a < prev    next >
Encoding:
Text File  |  1996-05-01  |  8.0 KB  |  264 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        Scrap.a
  3. ;
  4. ;    Contains:    Scrap Manager Interfaces.
  5. ;
  6. ;    Version:    Technology:    System 7.5
  7. ;                Release:    Universal Interfaces 3.0d3 on Copland DR1
  8. ;
  9. ;    Copyright:    © 1984-1996 by Apple Computer, Inc.  All rights reserved.
  10. ;
  11. ;    Bugs?:        If you find a problem with this file, send the file and version
  12. ;                information (from above) and the problem description to:
  13. ;
  14. ;                    Internet:    apple.bugs@applelink.apple.com
  15. ;                    AppleLink:    APPLE.BUGS
  16. ;
  17. ;
  18.     IF &TYPE('__SCRAP__') = 'UNDEFINED' THEN
  19. __SCRAP__ SET 1
  20.  
  21.     IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
  22.     include 'Types.a'
  23.     ENDIF
  24.     IF &TYPE('__FILEMANAGER__') = 'UNDEFINED' THEN
  25.     include 'FileManager.a'
  26.     ENDIF
  27. ;
  28. ;_________________________________________________________________________________________________________
  29. ; • STUCTURES
  30. ;_________________________________________________________________________________________________________
  31. ;
  32.  
  33.  
  34. ; typedef UInt32                         ScrapItemUserReference
  35.  
  36. ; typedef OSType                         ScrapItemType
  37.  
  38.     IF FOR_SYSTEM8_PREEMPTIVE THEN
  39. ;
  40. ;_________________________________________________________________________________________________________
  41. ; • SCRAP ITEM TYPE ATTRIBUTES
  42. ;_________________________________________________________________________________________________________
  43. ;
  44. ; typedef OptionBits                     ScrapItemTypeAttributes
  45.  
  46.  
  47. kScrapItemTypeNoAttributes        EQU        $00                    ; No scrap item type attributes
  48. kScrapItemTypeSenderOnly        EQU        $01                    ; Scrap item type is available to sender only
  49. kScrapItemTypeSenderTranslated    EQU        $02                    ; Scrap item type is translated by sender
  50. kScrapItemTypeNotSaved            EQU        $04                    ; Scrap item type should not be saved
  51. kScrapItemTypeSystemTranslated    EQU        $0100                ; Scrap item type is translated by Scrap Manager
  52. ;
  53. ;_________________________________________________________________________________________________________
  54. ; • FSOBJECTREF SCRAP ITEM TYPE
  55. ;_________________________________________________________________________________________________________
  56. ;
  57.  
  58. kScrapItemTypeFSObject            EQU        'fsob'                ; scrap item type for FSObjectRef data
  59.  
  60.  
  61. FSObjectScrapItemType    RECORD 0
  62. objectInfo_o             ds        FSObjectInformation ; offset: $0 (0)    ;  FSObject information
  63. object_t                 ds.l    1                ; offset: $6C (108)        ;  FSObjectRef - Call FSObjectRefRegister() before using
  64. sizeof                     EQU *                    ; size:   $70 (112)
  65.                         ENDR
  66. ;
  67. ;_________________________________________________________________________________________________________
  68. ;    
  69. ; • FSOBJECTREF PROMISE SCRAP ITEM TYPE
  70. ;_________________________________________________________________________________________________________
  71. ;
  72.  
  73. kScrapItemTypePromiseFSObject    EQU        'pfob'                ; Scrap item type for promised FSObjectRef data
  74.  
  75.  
  76. PromiseFSObjectScrapItemType RECORD 0
  77. objectInfo_o             ds        FSObjectInformation ; offset: $0 (0)    ;  FSObject information
  78. promisedScrapItemType     ds.l    1                ; offset: $6C (108)        ;  Promised scrap item type containing an FSObjectRef
  79. sizeof                     EQU *                    ; size:   $70 (112)
  80.                         ENDR
  81. ;
  82. ;_________________________________________________________________________________________________________
  83. ; • CREATING & DELETING SCRAPS
  84. ;_________________________________________________________________________________________________________
  85. ;
  86. ;
  87. ; extern OSStatus NewScrapRef(ScrapRef *scrapReference)
  88. ;
  89.     IF GENERATINGCFM THEN
  90.         IMPORT_CFM_FUNCTION NewScrapRef
  91.     ENDIF
  92.  
  93. ;
  94. ; extern OSStatus DisposeScrapRef(ScrapRef scrapReference)
  95. ;
  96.     IF GENERATINGCFM THEN
  97.         IMPORT_CFM_FUNCTION DisposeScrapRef
  98.     ENDIF
  99.  
  100. ;
  101. ;_________________________________________________________________________________________________________
  102. ; • ADDING SCRAP ITEMS
  103. ;_________________________________________________________________________________________________________
  104. ;
  105. ;
  106. ; extern OSStatus AddScrapItemType(ScrapRef scrapReference, ScrapItemUserReference newOrExistingUserReference, ScrapItemType newItemType, void *data, ByteCount dataSize)
  107. ;
  108.     IF GENERATINGCFM THEN
  109.         IMPORT_CFM_FUNCTION AddScrapItemType
  110.     ENDIF
  111.  
  112. ;
  113. ; extern OSStatus SetScrapItemTypeData(ScrapRef scrapReference, ScrapItemUserReference existingUserReference, ScrapItemType existingItemType, const void *data, ByteCount dataSize, UInt32 dataOffset)
  114. ;
  115.     IF GENERATINGCFM THEN
  116.         IMPORT_CFM_FUNCTION SetScrapItemTypeData
  117.     ENDIF
  118.  
  119. ;
  120. ; extern OSStatus SetScrapItemTypeAttributes(ScrapRef scrapReference, ScrapItemUserReference existingUserReference, ScrapItemType existingItemType, ScrapItemTypeAttributes attributes)
  121. ;
  122.     IF GENERATINGCFM THEN
  123.         IMPORT_CFM_FUNCTION SetScrapItemTypeAttributes
  124.     ENDIF
  125.  
  126. ;
  127. ; extern OSStatus SetScrapItemTypePromiseHint(ScrapRef scrapReference, ScrapItemUserReference existingUserReference, ScrapItemType existingItemType, UInt32 userPromiseHint)
  128. ;
  129.     IF GENERATINGCFM THEN
  130.         IMPORT_CFM_FUNCTION SetScrapItemTypePromiseHint
  131.     ENDIF
  132.  
  133. ;
  134. ;_________________________________________________________________________________________________________
  135. ; • GETTING SCRAP ITEM INFORMATION
  136. ;     NOTE: ALL INDEXES ARE 1 BASED (1 .. N)
  137. ;_________________________________________________________________________________________________________
  138. ;
  139. ;
  140. ; extern OSStatus CountScrapItems(ScrapRef scrapReference, ItemCount *numberScrapItems)
  141. ;
  142.     IF GENERATINGCFM THEN
  143.         IMPORT_CFM_FUNCTION CountScrapItems
  144.     ENDIF
  145.  
  146. ;
  147. ; extern OSStatus GetScrapItem(ScrapRef scrapReference, UInt32 scrapItemIndex, ScrapItemUserReference *userReference)
  148. ;
  149.     IF GENERATINGCFM THEN
  150.         IMPORT_CFM_FUNCTION GetScrapItem
  151.     ENDIF
  152.  
  153. ;
  154. ; extern OSStatus CountScrapItemTypes(ScrapRef scrapReference, ScrapItemUserReference userReference, ItemCount *numberItemTypes)
  155. ;
  156.     IF GENERATINGCFM THEN
  157.         IMPORT_CFM_FUNCTION CountScrapItemTypes
  158.     ENDIF
  159.  
  160. ;
  161. ; extern OSStatus GetScrapItemType(ScrapRef scrapReference, ScrapItemUserReference userReference, UInt32 itemTypeIndex, ScrapItemType *itemType)
  162. ;
  163.     IF GENERATINGCFM THEN
  164.         IMPORT_CFM_FUNCTION GetScrapItemType
  165.     ENDIF
  166.  
  167. ;
  168. ; extern OSStatus GetScrapItemTypeDataSize(ScrapRef scrapReference, ScrapItemUserReference userReference, ScrapItemType itemType, ByteCount *itemTypeDataSize)
  169. ;
  170.     IF GENERATINGCFM THEN
  171.         IMPORT_CFM_FUNCTION GetScrapItemTypeDataSize
  172.     ENDIF
  173.  
  174. ;
  175. ; extern OSStatus GetScrapItemTypeData(ScrapRef scrapReference, ScrapItemUserReference userReference, ScrapItemType itemType, void *data, ByteCount *dataSize, UInt32 *dataOffset)
  176. ;
  177.     IF GENERATINGCFM THEN
  178.         IMPORT_CFM_FUNCTION GetScrapItemTypeData
  179.     ENDIF
  180.  
  181. ;
  182. ; extern OSStatus GetScrapItemTypeAttributes(ScrapRef scrapReference, ScrapItemUserReference userReference, ScrapItemType itemType, ScrapItemTypeAttributes *attributes)
  183. ;
  184.     IF GENERATINGCFM THEN
  185.         IMPORT_CFM_FUNCTION GetScrapItemTypeAttributes
  186.     ENDIF
  187.  
  188.     ENDIF
  189.     IF FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED THEN
  190. ;
  191. ;_________________________________________________________________________________________________________
  192. ; • CLASSIC SCRAP MANAGER API
  193. ;_________________________________________________________________________________________________________
  194. ;
  195. ScrapStuff                RECORD 0
  196. scrapSize                 ds.l    1                ; offset: $0 (0)
  197. scrapHandle                 ds.l    1                ; offset: $4 (4)
  198. scrapCount                 ds.w    1                ; offset: $8 (8)
  199. scrapState                 ds.w    1                ; offset: $A (10)
  200. scrapName                 ds.l    1                ; offset: $C (12)
  201. sizeof                     EQU *                    ; size:   $10 (16)
  202.                         ENDR
  203. ; typedef struct ScrapStuff *            PScrapStuff
  204.  
  205. ; typedef struct ScrapStuff *            ScrapStuffPtr
  206.  
  207. ;
  208. ; pascal ScrapStuffPtr InfoScrap(void )
  209. ;
  210.     IF ¬ GENERATINGCFM THEN
  211.         _InfoScrap:    OPWORD    $A9F9
  212.     ELSE
  213.         IMPORT_CFM_FUNCTION InfoScrap
  214.     ENDIF
  215.  
  216. ;
  217. ; pascal SInt32 UnloadScrap(void )
  218. ;
  219.     IF ¬ GENERATINGCFM THEN
  220.         _UnloadScrap:    OPWORD    $A9FA
  221.     ELSE
  222.         IMPORT_CFM_FUNCTION UnloadScrap
  223.     ENDIF
  224.  
  225. ;
  226. ; pascal SInt32 LoadScrap(void )
  227. ;
  228.     IF ¬ GENERATINGCFM THEN
  229.         _LoadScrap:    OPWORD    $A9FB
  230.     ELSE
  231.         IMPORT_CFM_FUNCTION LoadScrap
  232.     ENDIF
  233.  
  234. ;
  235. ; pascal SInt32 GetScrap(Handle hDest, ResType theType, SInt32 *offset)
  236. ;
  237.     IF ¬ GENERATINGCFM THEN
  238.         _GetScrap:    OPWORD    $A9FD
  239.     ELSE
  240.         IMPORT_CFM_FUNCTION GetScrap
  241.     ENDIF
  242.  
  243. ;
  244. ; pascal SInt32 ZeroScrap(void )
  245. ;
  246.     IF ¬ GENERATINGCFM THEN
  247.         _ZeroScrap:    OPWORD    $A9FC
  248.     ELSE
  249.         IMPORT_CFM_FUNCTION ZeroScrap
  250.     ENDIF
  251.  
  252. ;
  253. ; pascal SInt32 PutScrap(SInt32 length, ResType theType, void *source)
  254. ;
  255.     IF ¬ GENERATINGCFM THEN
  256.         _PutScrap:    OPWORD    $A9FE
  257.     ELSE
  258.         IMPORT_CFM_FUNCTION PutScrap
  259.     ENDIF
  260.  
  261.     ENDIF
  262.     ENDIF ; __SCRAP__ 
  263.  
  264.